During computer rendering, a digitized image and/or image related information (for instance depth information, Z) is usually represented as a two-dimensional (2D) array of values, one for each of [x, y], where [x, y] are coordinates of the image surface. The rendering process renders primitives (e.g., triangles) in different areas of an image. A rendering device, such as a processor, can include multiple instances of similar classes of resources, such as processing pipes, cache line, memory channels, etc. required for the rendering process. Each of the classes of resources, such as those enumerated above, can include multiple similar items each assigned a unique device identification (ID) to differentiate it from similar devices. Optimally, as many resources as possible are used simultaneously.
Direct mapping can be used, either to simplify the implementations (such as with caches) or because a resource cannot be easily reallocated during the processing time. For example, a resource may not be readily reallocated during the processing time because of pixel locations values in an external memory. In this case, each item of a resource, identified by its unique device ID, is allocated to some set of pixels defined by a set of {[x, y]} coordinates. This allocation defines a mapping from [x, y] to the set of the resource items. Different pixels generally share the same resource which can tend to exacerbate the problem of an effective reallocation of resources.
It is difficult to achieve a uniform mapping of resources using conventional mapping techniques that rely solely on dyadic permutations. A 2D rendering can be especially difficult when using resource items that include numbers of resource items that are not powers of two. Moreover, if a resource item in turn consists of the several items of a different resource, (say, a memory channel has several banks), then the optimal mapping for both type of the resource is even more difficult to achieve. The conventional mappings tend to be inflexible and difficult to implement it in a programmable/parameterized way.
For efficient rendering, it is also preferred to maximize resource utilization. This typically infers that at any given time interval, most of the resource items are in use. Also, as the rendering process has some locality properties in [x, y], the same resource item should not be mapped to too many pixels in a small neighborhood, which can result in collisions during resource requests. FIG. 1 is a diagram illustrating poor resource mapping for three resources with device or resource IDs 0, 1, and 2. Hence, there exists a problem of efficiently allocating instances of similar resources, for example to particular pixels identified by their coordinates [x, y].